const LoginModule = {
  namespaced: true,
  state() {
    return {
      useraccount: "",
      password: "",
      userId: "",
      token: "",
      roleNames: [],
      username: "",
    };
  },
  mutations: {
    login(state, payload) {
      const { useraccount, password, userId, token, roleNames, username } = payload;
      state.useraccount = useraccount;
      state.password = password;
      state.userId = userId;
      state.token = token;
      state.roleNames = roleNames;
      state.username = username;
    },
  },
  actions: {
    loginAction(context, payload) {
      context.commit("login", payload);
    },
  },
};
export default LoginModule;
